package com.zkh.myframe.server;

import com.zkh.myutils.system.ConfigLoader;

public class SSLConfig {
	/**
	 * 秘钥库文件地址
	 */
	private String keystoreFile;
	/**
	 * 秘钥库密码，支持“ENC(加密串)”格式
	 */
	private String keystorePass;
	/**
	 * SSL协议
	 */
	private String sslProtocol;

	public String getKeystoreFile() {
		return keystoreFile;
	}
	public String getKeystoreFile(String dftKeystoreFile) {
		return keystoreFile==null ? dftKeystoreFile : keystoreFile;
	}
	public void setKeystoreFile(String keystoreFile) {
		this.keystoreFile = keystoreFile;
	}
	public String getKeystorePass(String dftKeystorePass) {
		//密码
		String pass = keystorePass==null ? dftKeystorePass : keystorePass;
		//解密
		return ConfigLoader.decodeEnc(pass);
	}
	public void setKeystorePass(String keystorePass) {
		this.keystorePass = keystorePass;
	}
	public String getSslProtocol() {
		return sslProtocol;
	}
	public String getSslProtocol(String dftSslProtocol) {
		return sslProtocol==null ? dftSslProtocol : sslProtocol;
	}
	public void setSslProtocol(String sslProtocol) {
		this.sslProtocol = sslProtocol;
	}
}
